﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Huirui.Cavan.Domain.MainBoundedContext.ReportModule;
using Spring.Data.Generic;

namespace Huirui.Cavan.Infrastructure.Data.MainBoundedContext.PurchaseModule
{
    public class PurchaseOrderReportMapper : IRowMapper<PurchaseOrderReport>
    {
        #region IRowMapper<PurchaseOrderReport> 成员

        public PurchaseOrderReport MapRow(System.Data.IDataReader reader, int rowNum)
        {
            PurchaseOrderReport report = new PurchaseOrderReport();
            report.SupplierCode = reader.GetString(0);
            report.SupplierName = reader.GetString(1);
            report.PurchaseOrderCode = reader.GetString(2);
            report.StockInStatus = reader.GetInt32(3);
            report.PurchaseEmployeeCode = reader.GetString(4);
            report.Number = reader.GetInt32(5);
            report.UnitCost = reader.GetDecimal(6);
            report.WholeAmount = reader.GetDecimal(7);
            report.UnStockInNumber = reader.GetDecimal(8);
            report.UnStockInAmount = reader.GetInt32(9);
            report.CreateDate = reader.GetDateTime(10);
            report.StockInDate = reader.GetDateTime(11);

            return report;
        }

        #endregion
    }
}
